import 'package:flutter_magic_planet/common/http/request.dart';
import 'package:flutter_magic_planet/model/video_api_source.dart';

class API {
  static const fast_mock = 'https://www.fastmock.site';
  static const video_api_source_url =
      '$fast_mock/mock/65ffd9eb5c0b9a8445915e0fc6556fa0/app/video/api/source';

  /// 视频API资源
  static Future<List<VideoApiSource>> getVideoApiSource() async {
    final response = await Request.get(
      action: '$video_api_source_url',
    );
    if (response == null) {
      return [];
    }
    List _list = response;
    return _list.map((e) => VideoApiSource.fromJson(e)).toList();
  }
}
